#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef double db;

#define in read()
#define pii pair<int,int>
#define fi first
#define se second
#define FILE(x) freopen(x".in","r",stdin);\
	freopen(x".out","w",stdout);
#define pb push_back

int read(){
	int x = 0,sgn = 1;char ch = getchar();
	for(;!isdigit(ch);ch = getchar()) if(ch == '-') sgn = -1;
	for(;isdigit(ch);ch = getchar()) x = (x<<1)+(x<<3)+(ch^48);
	return x*sgn;
}

const int N = 1e5+10;
const int inf = 0x3f3f3f3f;

int t[N],tc,c1,c2,n1,n2,ans = inf,n;
deque<pii> q;

int F(int x){
	int res = x * (tc - c2); q.clear();
	q.push_front(pii(-n2,x));
	for(int i = 1;i <= n;i++){
		if(i > n1) q.push_front(pii(i - n1,t[i - n1]));
		int m = t[i];
		while(m){
			if(!q.size()) return inf;
			pii t = q.back();
			if(t.fi + n2 <= i && c1 > c2){
				q.pop_back(); int k = min(m,t.se);
				t.se -= k; m -= k; res += k * c2;
				if(t.se) q.push_back(t);
			}else{
				t = q.front(); q.pop_front(); int k = min(m,t.se);
				t.se -= k; m -= k; res += k * c1;
				if(t.se) q.push_front(t);
			}
		}
	}
	return res;
}

int main (){
#ifndef ONLINE_JUDGE
	freopen("1.in","r",stdin);
#endif
	n = in; n1 = in,n2 = in,c1 = in,c2 = in,tc = in;
	if(n1 > n2) swap(n1,n2),swap(c1,c2);
	int l = 1,r = 0;
	for(int i = 1;i <= n;i++) t[i] = in,r += t[i];
	while(r - l >= 20){
		int del = (r - l) / 3;
		int nl = l + del,nr = r - del;
		if(F(nl) > F(nr)) l = nl;
		else r = nr;
	}
	for(int i = l;i <= r;i++) ans = min(ans,F(i));
	printf("%d\n",ans);
	return 0;
}

